﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace DBCommon
{
    public class DBConnect : IDisposable
    {
        
        //SQL Connection 개체
        private SqlConnection dbConn;


        /// <summary>
        /// 생성자
        /// </summary>
        public DBConnect()
        {

        }

        /// <summary>
        /// 소멸자
        /// </summary>
        public void Dispose()
        {

        }
        

        

        /// <summary>
        /// Connection 개체 생성
        /// </summary>
        /// <param name="sContype">000 : 운영서버, 999 : 개발서버</param>
        /// <returns></returns>
        public SqlConnection CreateConnection(string sContype)
        {
                        
            dbConn = new SqlConnection();

            try
            {  
                //운영서버
                if (sContype == "000")
                {
                    dbConn.ConnectionString =  "Server=;database=;uid=;pwd=;";
                }
                //개발서버
                else
                {
                    dbConn.ConnectionString = "Server=;database=;uid=;pwd=;";
                }
            }
            catch(Exception ex)
            {
                //로그생성
            }

            return dbConn;
        }


        void IDisposable.Dispose() { }



    }
}
